<%@include file="/WEB-INF/pages/commons/commons.jsp" %>

<stripes:layout-render name="${_themePath}/basic-layout-without-navbar.jsp" _title="Add Space">

    <stripes:layout-component name="_topNav">
        <H1>Add Space</H1>
        <UL class="gc-topnav-tabs">
            <LI>&nbsp;</LI>
        </UL>
    </stripes:layout-component>


    <stripes:layout-component name="_content">

        <h2>Description [<a id="_showDescription" href="#">Show</a>/<a id="_hideDescription" href="#">Hide</a> ]</h2>
        <span id="_description">
            Add a new space here. If you are the one creating the space, you'll be able to do anything on it. Adding,
            removing Pages adding member to it etc. You will probably only want to add member to your space that
            serves as the moderator of the space where the moderator will be able to delete pages that are not created
            by him. Registered user are able to add, alter any pages, put comments on your space but not remove those pages,
            spaces or comments.
            <p/>
            <p/>
            <p/>
        </span>


        <stripes:useActionBean
                var="utilitiesActionBean"
                alwaysExecuteEvent="false"
                beanclass="foo.bar.wiki.web.action.general.UtilitiesActionBean"
                event="themes" />

        <h2>Space details</h2>
        <stripes:messages/>
        <stripes:errors globalErrorsOnly="true"/>

        <jsecurity:hasPermission name="space:addSpace:${actionBean.space.id}">
        <stripes:form beanclass="foo.bar.wiki.web.action.space.AddSpaceActionBean">
        <stripes:errors/>
        <table width="100%">
            <tr>
                <td>Name:</td>
                <td><stripes:text name="space.name" /></td>
            </tr>
            <tr>
                <td>Description:</td>
                <td><stripes:textarea name="space.description" style="width:100%;" rows="5" /></td>
            </tr>
            <tr>
                <td>Theme: </td>
                <td><stripes:select name="space.themeName"><stripes:options-collection collection="${utilitiesActionBean.themes}"/></stripes:select></td>
            </tr>
            <tr>
                <td colspan="2"><stripes:submit name="save">Save</stripes:submit></td>
            </tr>
        </table>
        </stripes:form>
        </jsecurity:hasPermission>
        <jsecurity:lacksPermission name="space:addSpace:${actionBean.space.id}">
            Lacks "space:addSpace:${actionBean.space.id}" permission
        </jsecurity:lacksPermission>
    </stripes:layout-component>

</stripes:layout-render>



